<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
		<title>生命体征检测云平台</title>
		<link rel="shortcut icon" href="static/logo.ico" />
		<link rel="stylesheet" href="static/css/index.css" />
		<link rel="stylesheet" href="static/layui/css/layui.css" />
		<script type="text/javascript" src="static/js/jquery.min.js"></script>
		<script src="static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="static/js/vue.js"></script>
		<script type="text/javascript" src="static/js/axios.min.js"></script>
		<style>
			html,
			body,
			#container {
				height: 100%;
				width: 100%;
			}

			.container {
				height: auto;
				width: 100%;
			}

			.container2 {
				height: auto;
				width: 100%;
			}

			.collision-btn.disable {
				background-image: none;
				color: lightgrey;
				border-color: lightgrey;
				cursor: not-allowed;
			}

			.collision-btn.disable:hover {
				background-color: #fff;
				border-color: lightgrey;
			}

			.input-card .btn {
				margin-right: .8rem;
			}

			.amap-marker {
				opacity: 0.01;
			}

			.nav-right {
				top: 1.5rem !important;
			}

			.info {
				z-index: 999 !important;
			}
		</style>
		<script>
			layui.use('dropdown', function() {
				var dropdown = layui.dropdown;
				var layer = layui.layer;
				dropdown.on('click(docDemoMenu1)', function(options) {
					var othis = $(this); //当前菜单列表的 DOM 对象
					console.log(options.url)

				});
				$("#switchs").click(function() {
					layer.confirm('您确定切换成家庭用户？', {
						btn: ['确定', '取消'] //按钮
					}, function() {
						window.location = 'home.html'
					});
				})
			});
			$(function() {
				$("#pnav").load("public_navigation.html");
				$(".sign_out").click(function() {
					localStorage.clear();
					window.location = 'login.html'
				});
			});
		</script>
	</head>
	<body>
		<div id="app">
			<div style="margin-top: 70px;background-color: #e5e5e5;"></div>
			<div class="layui-panel" style="float: left; width: 10% !important;" id="pnav">
			</div>
			<div class="container" style="width: 90% !important; float: right;padding-left: 30px;">
				<div class="layui-fluid">
					<fieldset class="layui-elem-field layui-field-title">
						<legend>个人中心</legend>
					</fieldset>
					<div class="layui-row">
						<div class="layui-col-sm3"
							style="padding: 20px;box-shadow: 0 2px 4px 0 rgba(0,0,0,.1);background: #fff;">
							<div class="grid-demo grid-demo-bg1">
								<div class="layui-row">
									<div class="layui-col-md9" style="font-size: 18px;padding: 20px;">
										基本信息
									</div>
									<div class="layui-col-md3" style="font-size: 18px;padding: 20px;">
										<a class="layui-btn layui-btn-normal" href="user_info.html"
											style="float: left;height: 25px;line-height: 25px !important; background-color: #fff !important; color:#3d6eff;">编辑</a>
									</div>
								</div>
								<div class="layui-row" style="padding: 20px;">
									<div class="layui-col-md12">
										<img src="static/image/user.png"
											style="background-color: #eaeaea;border-radius: 58%; width: 110px;height: 110px;" />
									</div>
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md9" style="font-size: 16px;padding: 15px;">
									<span style="font-size: 14px;">名称：</span><span
										style="font-size: 14px;">{{uInfoData.userName}}
										-{{uInfoData.phone}}</span>
								</div>
								<div class="layui-col-md3" style="font-size: 16px;padding: 15px;">
									<!-- 								<a class="layui-btn layui-btn-normal" href="#"
									style="float: left;height: 25px;line-height: 25px !important; background-color: #fff !important; color:#3d6eff;" id="switchs">切换</a> -->
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 15px;">
									<span style="font-size: 14px;">性别：</span><span style="font-size: 14px;"
										v-if="uInfoData.sex==1">男</span><span style="font-size: 14px;" v-else>女</span>
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 15px;">
									<span style="font-size: 14px;">生日：</span><span
										style="font-size: 14px;">{{uInfoData.bringDate}}</span>
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 15px;">
									<span style="font-size: 14px;">身高：</span><span
										style="font-size: 14px;">{{uInfoData. hight}}CM</span>
								</div>
							</div>

							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 16px;">
									<span style="font-size: 14px;">体重：</span><span
										style="font-size: 14px;">{{uInfoData.weight}}KG</span>
								</div>
							</div>
						</div>
						<div class="layui-col-sm8 "
							style="padding: 20px;box-shadow: 0 2px 4px 0 rgba(0,0,0,.1);background: #fff;margin-left: 10px;">
							<div class="layui-row">
								<div class="layui-col-md9" style="font-size: 18px;padding: 20px;">
									安全设置
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 20px;">
									<span style="font-size: 14px;">绑定手机：</span><span
										style="font-size: 14px;">{{uInfoData.phone}}</span>
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 20px;">
									<div style="font-size: 14px;">绑定设备数 ：<span id="sbs" style="font-size: 16px;margin-right: 5px;"></span>台</div>
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 20px;">
									<span style="font-size: 14px;">登录密码：</span><a class="layui-btn layui-btn-normal"
										href="user_password.html"
										style="height: 25px;line-height: 25px !important; background-color: #fff !important; color:#3d6eff;font-size: 14px;">点击修改</a>
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 20px;">
									<span style="font-size: 14px;">家庭组管理：</span><a class="layui-btn layui-btn-normal"
										href="family_management_list.html"
										style="height: 25px;line-height: 25px !important; background-color: #fff !important; color:#3d6eff;font-size: 14px;">点击查看</a>
								</div>
							</div>
							<div class="layui-row">
								<div class="layui-col-md12" style="font-size: 16px;padding: 20px;">
									<span style="font-size: 14px;">修改社区：</span><a class="layui-btn layui-btn-normal"
										href="user_info.html"
										style="height: 25px;line-height: 25px !important; background-color: #fff !important; color:#3d6eff;font-size: 14px;">点击修改</a>
								</div>
							</div>
						<div class="layui-row">
							<div class="layui-col-md12" style="font-size: 16px;padding: 20px;">
								<span style="font-size: 14px;">过往病史：</span><span style="font-size: 14px;"><a
										class="layui-btn layui-btn-normal" href="basis_of_disease.html"
										style="height: 25px;line-height: 25px !important; background-color: #fff !important; color:#3d6eff;font-size: 14px;">点击查看</a></span>
							</div>
						</div>

						</div>

					</div>
				</div>
			</div>
			<div class="info">
				<div class="nav-left">
					<a class="login"></a>
					<a class="hometext" href="index.html" v-if="uInfoData.loginType !=1">首页</a>
					<a class="hometext" href="home.html" v-if="uInfoData.loginType == 1">首页</a>
				</div>
				<div class="nav-right">
					<ul>
						<li><a href="monitoring.html" v-if="uInfoData.loginType !=1">监测</a></li>
						<li><a href="historical_data.html" v-if="uInfoData.loginType !=1">历史数据</a></li>
						<li><a href="historical_info.html" v-if="uInfoData.loginType == 1">历史数据</a></li>
						<li><a href="call_p.html">离床报警</a></li>
						<li><a href="#">康养中心</a></li>
						<li><a href="#">中医问诊</a></li>
					</ul>
				</div>
				<div class="userinfo" id="userinfo">
					<img src="static/image/user.png" />
					<!-- <div class="red-dot"></div> -->
					<ul class="user_dropdown">
						<li class="dropdown_item user_ctrl">
							<div class="nickname">{{uInfoData.userName}}</div>
							<div class="sign_out">退出</div>
						</li>
						<li class="dropdown_item msg_item">
							<a href="user.html" target="_blank">
								<span>个人中心</span>
							</a>
						</li>
						<li class="dropdown_item msg_item">
							<a href="my_message.html" target="_blank">
								<span>我的消息</span>
								<span class="msg_unread unread_count show">0</span>
							</a>
						</li>
						<li class="dropdown_item">
							<a href="equipment.html">
								<span>设备</span>
							</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="static/js/config.js"></script>
		<script>
			var vm = new Vue({
				el: '#app', //设置当前vue对象可以操作数据的范围,注意不要把vue对象绑定到body中，因为这样，vue需要控制整个页面的内容，效率太低了
				data: {
					uInfoData: [],
				},
				ready: function() {
					// this.getdata();
				},
				created: function() {
					this.getdata();
				},
				methods: {
					getdata: function() {
						sbs
						var rloginName = localStorage.loginName;
						console.log(rloginName)
						if (rloginName == ' ' || rloginName == 'null' || rloginName == undefined) {
							layer.msg('登录过期或者无权访问！', {
								time: 1000,
								end: function() {
									location.href = 'login.html'
								}
							})
						} else {
							axios({
									method: 'GET',
									url: url + "/user/userInfo/lquserOwnInfo?phoneNum=" + rloginName,
									data: {}
								})
								.then(function(response) {
									vm.uInfoData.hights = response.data.hight;
									vm.uInfoData = response.data;
								})
								
								axios({
										method: 'GET',
										url: url + "/user/equipment/infoList?userId=" + rloginName,
										data: {}
									})
									.then(function(response) {
											console.log(response.data.length)
											$('#sbs').text(response.data.length)
									})
						}
					},
				}
		 })
		</script>
	</body>
</html>
